package com.hougong.im.mapper;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.hougong.im.body.httpresponse.MyBaseInfoVo;
import com.hougong.im.body.httpresponse.SearchUserVo;
import com.hougong.im.entity.ChatUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 聊天用户表 Mapper 接口
 * </p>
 *
 * @author lsz
 * @since 2018-08-25
 */
public interface ChatUserMapper extends BaseMapper<ChatUser> {

    ChatUser selectByUserNamePwd(@Param("userName")String userName, @Param("password")String password);

    List<ChatUser> selectByUserName(@Param("userName")String userName);

    List<ChatUser> selectByNickName(@Param("nickName")String nickName);

    List<ChatUser> selectBySex(@Param("sex")int sex);

    List<ChatUser> selectByPhone(@Param("phone")String phone);


    MyBaseInfoVo selectMyBaseInfo(@Param("uid")Long uid);

    /**
     * 模糊查询 xxx% 前面最多10条
     * @param key
     * @return
     */
    List<SearchUserVo> selectUserLike(@Param("key")String key);

}
